﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UFSoft.UBF.Business;
using UFSoft.UBF.Eventing;
using UFIDA.U9.SM.Ship;
using UFIDA.U9.PM.PO;
using UFSoft.UBF.PL;
using UFIDA.U9.PM.Rcv;
using UFIDA.U9.SM.RMA;
using UFIDA.U9.SM.SO;
using UFIDA.U9.CBO.SCM.Customer;
using UFIDA.U9.PR.PurchaseRequest;
using UFSoft.UBF.Util.DataAccess;
using UFSoft.UBF.PL.Engine;


namespace UFIDA.U9.Cust.LS.PlugBE
{
    /// <summary>
    /// 新为橡塑
    /// 采购订单
    /// 提交时,清空私有扩展字段1 
    /// </summary>
    class XWXSPOExtend : IEventSubscriber
    {
        //配置XX.sub.xml文件放置到portal/bin下，dll文件放置到portal/ApplicationServer/Libs下
        public void Notify(params object[] args)
        {
            if (args != null && args.Length != 0 && args[0] is EntityEvent)
            {
                BusinessEntity.EntityKey key = ((EntityEvent)args[0]).EntityKey;
                UFIDA.U9.PM.PO.PurchaseOrder be = key.GetEntity() as UFIDA.U9.PM.PO.PurchaseOrder;
                if (be == null)
                    return;
                  if ((be.Status == PODOCStatusEnum.Approving && be.OriginalData.Status == PODOCStatusEnum.Opened))
                {
                    //提交
                    //清空私有字段
                    be.DescFlexField.PrivateDescSeg1 = "";
                }
            }
        }
    }
}
